const mongoose = require('../db');
const Schema = mongoose.Schema;

let MenuSchema = new Schema({
  key: { type: String, required: true },
  icon: { type: String, required: true },
  name: { type: String, required: true },
  role: { type: Array, required: false },
  parent: { type: String, required: false },
  children: { type: Array, required: false },
  sort: { type: String, required: true },
  path: { type: String, required: false },
  url: { type: String, required: false },
});

let MenuModel = mongoose.model('menu', MenuSchema);

module.exports = MenuModel;
